<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('字段属性配置新增及修改')" />
    <style type="text/css">
        .layui-input, .layui-textarea{width:calc(100% - 100px);}
        .layui-form-label{width:180px}
        .layui-form-select dl{margin-left:80px;min-width: calc(100% - 100px);}
        .layui-edge{margin-right:28px;}
    </style>
</head>
<body>
<form class="layui-form" id="form-dict-add" style="padding: 16px 84px 16px 25px;">
<input type="hidden" id="guid" name="guid"  th:value="${dictionaryForField?.guid}">
	<div class="layui-form-item">
	  <label class="layui-form-label">数据表名：</label>
	  <div class="layui-input-block">
	    <input type="text" name="moduleTable" id="moduleTable" th:value="${dictionaryForField?.moduleTable}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input layui-disabled" readonly>
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">列名：</label>
	  <div class="layui-input-block">
	    <input type="text" name="fieldName" id="fieldName" th:value="${dictionaryForField?.fieldName}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">列别名：</label>
	  <div class="layui-input-block">
	    <input type="text" name="fieldAlias" id="fieldAlias" th:value="${dictionaryForField?.fieldAlias}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">字段名：</label>
	  <div class="layui-input-block">
	    <input type="text" name="fields" id="fields" th:value="${dictionaryForField?.fields}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">字段序号：</label>
	  <div class="layui-input-block">
	    <input type="text" name="fieldid" id="fieldid" th:value="${dictionaryForField?.fieldid}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">字段长度：</label>
	  <div class="layui-input-block">
	    <input type="text" name="fieldLength" id="fieldLength" th:value="${dictionaryForField?.fieldLength}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">字段默认值：</label>
	  <div class="layui-input-block">
	    <input type="text" name="fieldValue" id="fieldValue" th:value="${dictionaryForField?.fieldValue}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">字段类型：</label>
	  <div class="layui-input-block">
	    <input type="text" name="fieldType" id="fieldType" th:value="${dictionaryForField?.fieldType}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">表头占用列数：</label>
	  <div class="layui-input-block">
	    <input type="text" name="fieldFrontTopSize" id="fieldFrontTopSize" th:value="${dictionaryForField?.fieldFrontTopSize}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">前台默认值：</label>
	  <div class="layui-input-block">
	    <input type="text" name="fieldFrontValue" id="fieldFrontValue" th:value="${dictionaryForField?.fieldFrontValue}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">前台列高度：</label>
	  <div class="layui-input-block">
	    <input type="text" name="fieldFrontHeight" id="fieldFrontHeight" th:value="${dictionaryForField?.fieldFrontHeight}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">前台列宽度：</label>
	  <div class="layui-input-block">
	    <input type="text" name="fieldFrontWidth" id="fieldFrontWidth" th:value="${dictionaryForField?.fieldFrontWidth}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">前台排列顺序：</label>
	  <div class="layui-input-block">
	    <input type="text" name="fieldFrontOrder" id="fieldFrontOrder" th:value="${dictionaryForField?.fieldFrontOrder}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">前台显示类型：</label>
	  <div class="layui-input-block">
	  <select name="fieldFrontTemplet" id="fieldFrontTemplet">
             <option th:each="fieldFrontTempletType:${fieldFrontTempletType}" th:value="${fieldFrontTempletType.key}" th:valuecn="${fieldFrontTempletType.value}" th:text="${fieldFrontTempletType.value}" th:selected="${fieldFrontTempletType.key} eq ${dictionaryForField?.fieldFrontTemplet}"></option>
      </select>
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">前台控件类型：</label>
	  	<div class="layui-input-block">
		  <select name="fieldFrontType" id="fieldFrontType">
	             <option th:each="controlType:${controlType}" th:value="${controlType.key}" th:valuecn="${controlType.value}" th:text="${controlType.value}" th:selected="${controlType.key} eq ${dictionaryForField?.fieldFrontType}"></option>
	      </select>
   		</div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">查询条件类型：</label>
	  <div class="layui-input-block">
		  <select name="fieldFrontConditionsType" id="fieldFrontConditionsType">
	             <option th:each="conditionsType:${conditionsType}" th:value="${conditionsType.key}" th:text="${conditionsType.value}" th:selected="${conditionsType.key} eq ${dictionaryForField?.fieldFrontConditionsType}"></option>
	      </select>
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">数据权限字段：</label>
	  	<div class="layui-input-block">
		  <select name="fieldDataLimit" id="fieldDataLimit">
	             <option th:each="dataLimitType:${dataLimitType}" th:value="${dataLimitType.key}" th:text="${dataLimitType.value}" th:selected="${dataLimitType.key} eq ${dictionaryForField?.fieldDataLimit}"></option>
	      </select>
    	</div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">字段显示控制：</label>
	  <div class="layui-input-block">
	  		<select name="fieldFrontTop" id="fieldFrontTop">
	             <option value="0" th:selected="'0' eq ${dictionaryForField?.fieldFrontTop}">制单网格</option>
				 <option value="7" th:selected="'7' eq ${dictionaryForField?.fieldFrontTop}">网格隐藏</option>
	             <option value="1" th:selected="'1' eq ${dictionaryForField?.fieldFrontTop}">表头显示</option>
	             <option value="2" th:selected="'2' eq ${dictionaryForField?.fieldFrontTop}">表头隐藏</option>
	             <option value="3" th:selected="'3' eq ${dictionaryForField?.fieldFrontTop}">制单隐藏</option>
	             <option value="5" th:selected="'5' eq ${dictionaryForField?.fieldFrontTop}">底部显示</option>
	             <option value="6" th:selected="'6' eq ${dictionaryForField?.fieldFrontTop}">底部隐藏</option>
				 <option value="8" th:selected="'8' eq ${dictionaryForField?.fieldFrontTop}">静态网格</option>
	      	</select>
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">是否主键：</label>
	  <div class="layui-input-block">
	    <input type="radio" name="fieldKey" value="0" title="no" checked>
	    <input type="radio" name="fieldKey" value="1" title="yes" th:checked="${dictionaryForField?.fieldKey}">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">是否查询条件：</label>
	  <div class="layui-input-block">
	    <input type="radio" name="fieldFrontConditions" value="0" title="no" checked>
	    <input type="radio" name="fieldFrontConditions" value="1" title="yes"  th:checked="${dictionaryForField?.fieldFrontConditions}">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">前台是否编辑：</label>
	  <div class="layui-input-block">
	    <input type="radio" name="fieldFrontEdit" value="0" title="no" checked>
	    <input type="radio" name="fieldFrontEdit" value="1" title="yes" th:checked="${dictionaryForField?.fieldFrontEdit}">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">是否指定可编辑：</label>
	  <div class="layui-input-block">
	    <input type="radio" name="fieldExceptEdit" value="0" title="no" checked>
	    <input type="radio" name="fieldExceptEdit" value="1" title="yes" th:checked="${dictionaryForField?.fieldExceptEdit}">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">前台是否固定：</label>
	  <div class="layui-input-block">
	    <input type="radio" name="fieldFrontFixed" value="0" title="no" checked>
	    <input type="radio" name="fieldFrontFixed" value="1" title="yes" th:checked="${dictionaryForField?.fieldFrontFixed}">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">前台是否隐藏：</label>
	  <div class="layui-input-block">
	    <input type="radio" name="fieldFrontHidden" value="0" title="no" checked>
	    <input type="radio" name="fieldFrontHidden" value="1" title="yes" th:checked="${dictionaryForField?.fieldFrontHidden}">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">是否允许为空：</label>
	  <div class="layui-input-block">
	    <input type="radio" name="fieldNull" value="0" title="no" checked>
	    <input type="radio" name="fieldNull" value="1" title="yes" th:checked="${dictionaryForField?.fieldNull}">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">前台是否必填：</label>
	  <div class="layui-input-block">
	    <input type="radio" name="fieldFrontRequired" value="0" title="no" checked>
	    <input type="radio" name="fieldFrontRequired" value="1" title="yes" th:checked="${dictionaryForField?.fieldFrontRequired}">
	  </div>
	</div>
	<div class="layui-form-item">
	  <label class="layui-form-label">是否开启合计：</label>
	  <div class="layui-input-block">
	    <input type="radio" name="fieldFrontTotal" value="0" title="no" checked>
	    <input type="radio" name="fieldFrontTotal" value="1" title="yes" th:checked="${dictionaryForField?.fieldFrontTotal}">
	  </div>
	</div>
</form>
<th:block th:include="include :: footer" />
<script type="text/javascript">
var prefix = ctx + "system/dictionaryforfield";
var $,layer,form,table;
layui.use(['table','form','layer','jquery'], function () {
     $ = layui.$,layer = layui.layer,form = layui.form,table = layui.table;
    if(!$('#moduleTable').val()){
        $('#moduleTable').val(window.location.href.split("=")[1]);	
    }
	//添加表单验证
	//$(".layui-layer-btn0").innerHTML('aa');
});
//提交调用的方法
function submitHandler() {
	if($('#guid').val()){//通过判断guid是否存在来判断是新增还是保存
		if ($.validate.form()) {
            $.operate.save(prefix + "/editpost", {'dictionaryForFieldItems':JSON.stringify([$.common.formToJSON('form-dict-add')])});
        }
	}else{
		if ($.validate.form()) {
			$.operate.save(prefix + "/addpost", {'dictionaryForFieldItems':JSON.stringify([$.common.formToJSON('form-dict-add')])});
		}
	}
}
</script>
</body>
</html>
